import javax.imageio.ImageIO;
import javax.swing.*;

import java.awt.*;
import java.awt.event.ActionListener;
import java.awt.event.ActionEvent;
import java.io.IOException;

public class Menu extends JFrame {
	public static String tytulOkna = "Menu";
	public static Dimension rozmiarOkna = new Dimension(300, 300);
	Dimension screenSize = Toolkit.getDefaultToolkit().getScreenSize();
	
	Point middle = new Point(screenSize.width / 2, screenSize.height / 2);
	Point newLocation = new Point(middle.x - rozmiarOkna.width/2, 
	                              middle.y - rozmiarOkna.width/2 + 80);
	
	private JPanel panel = new JPanel();
	
	public Menu() {
		setTitle(tytulOkna);
		setSize(rozmiarOkna);
		setUndecorated(true);
		setResizable(false);
		setLocation(newLocation);
		//setLocationRelativeTo(null);
		setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
		
		init();
	}	
	ImageIcon imgBack = new ImageIcon("res/bg.jpg");	
	public void init() {
		setLayout(new GridLayout(3, 1));

		//OknoGlowne okno = new OknoGlowne();
		
		JButton btnNowa = new JButton("Nowa Gra");	
		btnNowa.setMargin(new Insets(0, 0, 0, 0));
		
		
		
		
	//	btnNowa.setForeground(imgBack);
		// to remove the border
		//btnNowa.setBorder(null);
		
		add(btnNowa);		
		JButton btnStats = new JButton("Statystyki");
		add(btnStats);		
		JButton btnExit = new JButton("Wyjscie");
		add(btnExit);
		
		
		btnNowa.addActionListener(new ActionListener() {
            public void actionPerformed(ActionEvent e)
            {            	
            	NickDialog nickwindow = new NickDialog();
            	dispose();
            }
		});
		btnExit.addActionListener(new ActionListener() {
            public void actionPerformed(ActionEvent e)
            {            	
            	System.exit(0);
            }
		});
		
		
		setVisible(true);
	}	

}